package com.longxiao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.longxiao.entity.CourseChapter;

public interface CourseChapterMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(CourseChapter record);

    int insertSelective(CourseChapter record);

    CourseChapter selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CourseChapter record);

    int updateByPrimaryKey(CourseChapter record);
    
    List<CourseChapter> selectByCourseId(Integer courseId);
    
    CourseChapter selectFirstChapter();
    /*
     * 获取学生应该学习的下一章节
     */
    CourseChapter selectNextChapterSameCourse(@Param("courseName")String courseName,@Param("chapterName")String chapterName);
    /*
     * 获取学生应该学习的下一课程
     */
    CourseChapter selectNextChapterNextCourse(@Param("courseName")String courseName,@Param("chapterName")String chapterName);
    /*
     * 根据章节名称获取章节信息
     */
    CourseChapter selectByName(String name);
}